export default {
	SET_USER_INFO: (state, user) => {
		state.userInfo = user
		uni.setStorageSync('user-info', JSON.stringify(user))
	},
	SET_TOKEN: (state, token) => {
		state.token = token
		uni.setStorageSync('token', token)
	},
	INIT_USER_INFO: (state) => {
		const storageUserInfo = uni.getStorageSync('user-info')
		if (storageUserInfo) {
			const userInfo = JSON.parse(storageUserInfo)
			state.userInfo = userInfo
		}
		
	},
	INIT_TOKEN: (state) => {
		const storageToken = uni.getStorageSync('token')
		if (storageToken) {
			state.token = storageToken
		}
		
	},
	SET_CURRENT_ADDRESS: (state, address) => {
		state.currentAddress = address
	}
}
